﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Liang.Util
{
    public class GetEnumDescription
    {
        public static string GetName<T>(int nItemIndex)
        {
            string strDescription = "";

            Array item = Enum.GetValues(typeof(T));

            if (0 <= nItemIndex && nItemIndex < item.Length)
            {
                strDescription = Propety.GetDescription<T>(item.GetValue(nItemIndex).ToString());
            }

            return strDescription;
        }
    }
}
